﻿using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Objects;

namespace WindMill
{
    public static class DbContextExtesions
    {
        public static ObjectContext ToObjectContext(this DbContext db)
        {
            return ((IObjectContextAdapter) db).ObjectContext;
        }
        public static DbContext ToDbContext(this ObjectContext db)
        {
            return new DbContext(db,false);
        }
    }
}